<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/chaxun.css"
	type="text/css" />
</head>
<body>
	<div class="lanmu">
		<div class="nei">
			<div class="biaoqian">
				<a href="${pageContext.request.contextPath}/index">
					<li>首页</li>
				</a>
				<li>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</li> <a href="#">
					<li>新房</li>
				</a>
				<li>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</li> <a href="#">
					<li>二手房</li>
				</a>
				<li>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</li> <a href="#">
					<li>租房</li>
				</a>
				<li>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</li> <a href="#">
					<li>商铺写字楼</li>
				</a>
				<li>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</li> <a href="#">
					<li>海外地产</li>
				</a>

			</div>
		</div>
	</div>
	<div class="neibu">
		<div class="taitou">
			<div class="logo">
				<img src="img/logo.png" />
			</div>
			<div class="sousuo">
				<form action="${pageContext.request.contextPath}/house-list">
				<input class="sousuoanniu" type="submit" value="搜索" />
				<input class="sousuokuang" type="text" name="title" value="${title}"
					placeholder="请输入街道或者小区..." />
				</form>
			</div>
		</div>
		<div class="tiaojian">
			<a href="#">
				<li>区域找房</li>
			</a> <a href="#">
				<li>地铁找房</li>
			</a> <a href="#">
				<li>小区</li>
			</a>
		</div>
		<div class="suozaiweizhi">
			<p title="您所在位置">
				<a href="shouye.html"> 广州房产网 </a> > <a href="#"> 广州租房 </a>
			</p>
		</div>
		<div class="saixuan">
			<div class="saixuanxiang1">
				<div class="saixuanming">区域：</div>
				<a href="${pageContext.request.contextPath}/house-list?did=0&price=${price}&updateTime=${updateTime}&title=${title}">
					<div class="saixuanming">
						<strong style="color: green;"> 全部 </strong>
					</div>
				</a> 
				<c:forEach items="${districts}" var="district">
					<a href="${pageContext.request.contextPath}/house-list?did=${district.id}&price=${price}&updateTime=${updateTime}&title=${title}">
						<c:if test="${district.id==did}">
							<li style="background-color:#3E8F3E;color:#FFFFFF;">${district.name}</li>
						</c:if>
						<c:if test="${district.id!=did}">
							<li>${district.name}</li>
						</c:if>
					</a>
				</c:forEach>
			</div>
			<c:if test="${streets!=null}">
				<div class="dierjisaixuan">
					<div class="saixuanming">街道：</div>
					<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=0&tid=${tid}&price1=${price1}&price2=${price2}&price=${price}&updateTime=${updateTime}&title=${title}">
						<div class="saixuanming">
							<strong style="color: green;"> 全部 </strong>
						</div>
					</a> 
					<c:forEach items="${streets}" var="street">
						<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${street.id}&tid=${tid}&price1=${price1}&price2=${price2}&price=${price}&updateTime=${updateTime}&title=${title}">
							<c:if test="${street.id==sid}"><li style="background-color:#3E8F3E;color:#FFFFFF;">${street.name}</li></c:if>
							<c:if test="${street.id!=sid}"><li>${street.name}</li></c:if>
						</a>
					</c:forEach>
				</div>
			</c:if>
			<div class="saixuanxiang2">
				<div class="saixuanming">租金:</div>
				<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=0&price2=0&tid=${tid}&price=${price}&updateTime=${updateTime}&title=${title}">
					<div class="saixuanming">
						<strong style="color: green;"> 全部 </strong>
					</div>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price2=2000&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price2==2000}"><li style="background-color:#3E8F3E;color:#FFFFFF;">2000元以下</li></c:if>
					<c:if test="${price2!=2000}"><li>2000元以下</li></c:if>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=2001&price2=3000&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price1==2001 and price2==3000}"><li style="background-color:#3E8F3E;color:#FFFFFF;">2000-3000元</li></c:if>
					<c:if test="${price1!=2001 and price2!=3000}"><li>2000-3000元</li></c:if>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=3001&price2=4000&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price1==3001 and price2==4000}"><li style="background-color:#3E8F3E;color:#FFFFFF;">3000-4000元</li></c:if>
					<c:if test="${price1!=3001 and price2!=4000}"><li>3000-4000元</li></c:if>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=4001&price2=5000&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price1==4001 and price2==5000}"><li style="background-color:#3E8F3E;color:#FFFFFF;">4000-5000元</li></c:if>
					<c:if test="${price1!=4001 and price2!=5000}"><li>4000-5000元</li></c:if>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=5001&price2=6000&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price1==5001 and price2==6000}"><li style="background-color:#3E8F3E;color:#FFFFFF;">5000-6000元</li></c:if>
					<c:if test="${price1!=5001 and price2!=6000}"><li>5000-6000元</li></c:if>
				</a> <a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=6001&price=${price}&updateTime=${updateTime}&tid=${tid}&title=${title}">
					<c:if test="${price1==6001}"><li style="background-color:#3E8F3E;color:#FFFFFF;">6000元以上</li></c:if>
					<c:if test="${price1!=6001}"><li>6000元以上</li></c:if>
				</a>
			</div>

			<div class="saixuanxiang3">
				<div class="saixuanming">房型:</div>
				<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=0&price=${price}&updateTime=${updateTime}&title=${title}">
					<div class="saixuanming">
						<strong style="color: green;"> 全部 </strong>
					</div>
				</a> 
				<c:forEach items="${types}" var="type">
					<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${type.id}&price=${price}&updateTime=${updateTime}&title=${title}">
						<c:if test="${tid==type.id}"><li style="background-color:#3E8F3E;color:#FFFFFF;">${type.name}</li></c:if>
						<c:if test="${tid!=type.id}"><li>${type.name}</li></c:if>
					</a>
				</c:forEach>
			</div>


		</div>
		<div class="xianshileixing">
			<a href="#">
				<li>全部</li>
			</a>

		</div>
		<div class="paixu">
			<div class="wenzi">为您找到所选区域附近租房</div>
			<div class="paixuleixing">

				<li>排序：<a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=&updateTime=&title=${title}">默认</a>
				</li>

				<c:if test="${price!='price'}">
					<li><a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=price&updateTime=${updateTime}&title=${title}"> 租金</a></li>
				</c:if>
				<c:if test="${price=='price'}">
					<li><a style="color:orange;" href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=&updateTime=${updateTime}&title=${title}"> 租金</a></li>
				</c:if>
				<c:if test="${updateTime!='updateTime'}">
				<li><a href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=updateTime&title=${title}"> 最新</a></li>
				</c:if>
				<c:if test="${updateTime=='updateTime'}">
				<li><a style="color:orange;" href="${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=&title=${title}"> 最新</a></li>
				</c:if>
			</div>

		</div>
		<div class="zhanshi">
			<c:forEach items="${houses}" var="house">
				<a href="${pageContext.request.contextPath}/house?id=${house.id}">
				<div class="fangjieshao">
					<div class="img">
						<img src="${pageContext.request.contextPath}/images/${house.photo.filename}" />
					</div>
					<div class="jie">
						<br />
						<h3>${house.topic}</h3>
						<br />
						<p>${house.content}</p>
						<br />
						<p>
							联系人：<span>${house.user.name}</span> 联系方式：<span>${house.user.phone}</span>
						</p>
					</div>
					<div class="jiage">
						<p><fmt:formatNumber pattern="#.00" value="${house.price}"></fmt:formatNumber>元/月</p>
					</div>
				</div>
			</a>
			</c:forEach>
		</div>

		<div class="holder">
			<div class="anniubao">
				<div class="but1">
					<c:if test="${page>1}">
					<button class="back" onclick="window.location.href='${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=${updateTime}&page=${page-1}&title=${title}'">上一页</button>
					</c:if>
				</div>
				<div class="but2">
					<button class="site" onclick="window.location.href='${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=${updateTime}&page=1&title=${title}'">首页</button>
				</div>
				<c:forEach begin="1" end="${totalPage}" var="index">
					<div class="but3">
						<button class="site" onclick="window.location.href='${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=${updateTime}&page=${index}&title=${title}'">${index}</button>
					</div>
				</c:forEach>
				
				<div class="but5">
					<button class="site" onclick="window.location.href='${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=${updateTime}&page=${totalPage}&title=${title}'">末页</button>
				</div>
				<div class="but6">
					<c:if test="${page<totalPage}">
					<button class="button" onclick="window.location.href='${pageContext.request.contextPath}/house-list?did=${did}&sid=${sid}&price1=${price1}&price2=${price2}&tid=${tid}&price=${price}&updateTime=${updateTime}&page=${page+1}&title=${title}'">下一页</button>
					</c:if>
				</div>
				<div class="fenye"><span style="width:100px;">第${page}页/共${totalPage}页</span></div>
			</div>
			
		</div>
	</div>
	<div style="clear:both;"></div>
	<div class="yewei">
		<div class="tou">
			<hr />
			<br /> <a href="#"> 爱上城 </a> | | <a href="#"> 58车 </a>

		</div>
		<div class="shen">
			<br /> <a href="#"> 客户服务中心 </a> 违法信息举报： 4006209008 <a href="#">
				yinsibaohu@58.com </a> Copyright © 2007-2019 www.anjuke.com All Rights
			Reserved <a href="#"> ICP号：沪 B2-20090008 </a>
		</div>
		<div class="baozheng">
			<a href="#"> <img src="img/警察.png" />沪公网安备 31011502002124号
			</a>
		</div>
	</div>
</body>
</html>